//统一管理所有api

import request from './request'
import request2 from './request2'

// 按需导出

//用户登录
export const userLogin = (params) => request2.post('/auth/loginByWeb', params);

//获取书架广告
export const getBookSelfBanner = () => request.get('/shelf/banner.json')
    //书架书籍推荐
export const getBookSelfRecomd = () => request.get('/shelf/info.json')

//书架书籍详情
export const getBookSelfDetail = (url) => request.get(url);

//获取书城导航
export const getStoreNav = (params) => request.get('/store/navi.json', { params })
    //书城展示模块
export const getStoreData = (params) => request.get('/store/show.json', { params })


//获取所有频道
// export const getNodeData = (params) => request.get('/store/node.json', { params })
//获取频道下的所有分类
// export const getNodeCateData = (params) => request.get('/store/info.json', { params })
//频道和分类合并
export const getMergedCagegory = () => request.get('/mergedCategroy.json')
    //分类筛选条件
export const getcateByCondition = (url) => request.get(url);

//分类筛选结果列表
export const getResultData = (url) => request.get(url);

//热门搜索
export const hotWord = () => request.get('/search/getHotWords');
//热门搜索
export const searchSuggest = (params) => request.get('/search/searchHint', { params });
//热门搜索
export const searchResult = (params) => request.get('/search/book.json', { params });

//书籍详情书籍信息
export const bookDetailInfo = (params) => request.get('/book/info.json', { params });

//书籍详情
export const bookDetail = (params) => request.get('/book/getsub.json', { params });

//书籍章节
export const bookChapter = (params) => request.get('/reader/book/info.json', { params });
//书籍章节内容
export const bookChapterContent = (params) => request.get('/reader/book/content.json', { params });
//书籍评论列表
export const bookcommentList = (params) => request.get('/comment/getComments.json', { params });


//排行榜列表
// export const getRankList = (params) => request.get('/store/rankList.json', { params });
export const getRankList = (url) => request.get(url);

//排行榜分类
export const getRankData = (params) => request.get('/store/merged/rankNavi.json', { params });

export const getendbook = (url) => request.get(url);